/******************************************************************************
 cnome: A C++ source "genes" discover. :-)

 See more details at:

   http://www.codeplex.com/cnome

 The original author site is at: http://www.alemosbarbosa.com/

 Copyright (c) 2008-2010 Alexandre Lemos Barbosa.
 Distributed under the MIT License. (See accompanying file LICENSE-MIT.txt 
 or at http://www.codeplex.com/cnome/license)
 ******************************************************************************/

#ifndef VARIABLES_H
#define VARIABLES_H

#include "typedefs.h"
#include "parameter.h"
#include "iterator.h"
#include "identifier_zone.h"

namespace cnome {

struct var {
    static scopeT     scope;
    static lstScopeT  l_scope;
    static lstScopeT  l_typeDecl;
    static scopeT     typeDecl;
    static parameter_scope prms;
    static parameter_scope tmplPrms;
    static lstItSblsT l_usgDrts; // List of using directives
    static symbolPtr mthScope;
    static lstTdc     l_tdc;
    static scopeT     dcl_spc;
    static lstScopeT  l_dcl_spc;
    static symbolPtr tmplSbl;
    static bool       isScopeAbsolut;
    static std::size_t scopeSuffixSize;
    static lstSizesT   l_scopeSuffixSize;
    static eParameterType parameterType;
    static std::pair<iterator, iterator> lastDeclaratorId;
    static parameter_scope::eLevel scopeLevel;
	static identifier_zone identifierZone;
};

class sglLookahead {
public:
    static sglLookahead* instance() {
        if (!m_sgl)
            m_sgl = new sglLookahead;

        return m_sgl;
    }

    bool get_is_looking() { return m_isLooking>0; }

    void set_is_looking(bool is) {
        if (is)
            m_isLooking++;
        else 
            m_isLooking--;
    }

private:
    static sglLookahead* m_sgl;
    int m_isLooking;
    sglLookahead() : m_isLooking(0) {}
};

} // namespace cnome 

#endif // VARIABLES_H
